#ifndef UDP_RECV_THREAD_H
#define UDP_RECV_THREAD_H

#include "memberCenter.h"
#include "myThread.h"
#include "GroupCenter.h"
#include <map>
#include <string>
#include <WinSock.h>

class UDPRecvThread : public MyThread
{
public:
	UDPRecvThread();
	UDPRecvThread(memberCenter *member_center, groupCenter *group_center);
	~UDPRecvThread();

	void init(memberCenter *member_center, groupCenter *group_center);

private:
	UINT WINAPI threadWork();

	void handleMessageSearch(char *buf, sockaddr_in addr);
	void handleMessageSelfInfo(char *buf, sockaddr_in addr);
	void handleDummy(char *buf, sockaddr_in addr);

private:
	memberCenter *m_member_center;
	groupCenter  *m_group_center;
	static bool m_isrunning;
};

#endif